package com.sumainfor.wx.system.maket.service;

import com.sumainfor.common.util.ContextUtils;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.maket.dao.RdTenantMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Map;

/**
 * <p>
 *
 * <p>
 *
 * @author: zc
 * @create: 2019-08-23 11:22
 **/
@Service
public class RdTenantService implements Serializable {

    @Autowired
    RdTenantMapper rdTenantMapper;

    /**
     * 创建客户的时候现根据手机查询是否已经有租客存在
     */
    public JsonResult getTenantByTenMode(Map<String,Object> params){
        JsonResult result=new JsonResult();
        params.put("SetId", ContextUtils.getUserId());
        if (params.get("SetId")==null){
            result.putFailed("参数不正确");
        }
        Map<String,Object> map=rdTenantMapper.getTenantByTenMode(params);
        if (map!=null){
            result.put(map);
        }else{
            result.putFailed("服务器繁忙");
        }
        return result;
    }
}
